<!DOCTYPE html>
<html xmlns="http://java.sun.com/jsf/html">

<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>系统模块-新闻</title>
	<link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css" />
	<link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css" /></head>

<body>
<div class="page-content-wrap">
	<form class="layui-form">
		<div class="layui-tab" style="margin: 0;">
			<div class="layui-tab-content">
				<div class="layui-tab-item"></div>
				<input type="hidden" class="form-control id" id="id" name="id" value="${baseNews.id}" />
				<div class="layui-form-item">
					<label class="layui-form-label">
						<span class="red">*</span>&nbsp;&nbsp;新闻标题：</label>
					<div class="layui-input-block">
						<input type="text" name="title" value="${baseNews.title}" placeholder="请输入新闻标题" lay-verify="required" class="layui-input"></div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
						<span class="red">*</span>&nbsp;&nbsp;有效状态：</label>
					<div class="layui-input-block">
						<select class="form-control" name="status" lay-verify="required" id="status"></select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">
						<span class="red">*</span>&nbsp;&nbsp;排序：</label>
					<div class="layui-input-block">
						<input type="text" name="sort" value="${baseNews.sort}" placeholder="请输入排序" lay-verify="required" class="layui-input"></div>
				</div>
			</div>
		</div>
		<div class="layui-form-item" style="padding-left: 10px;">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBtn">提交</button>
				<button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
				<button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="${s.base}/lib/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/common.js"></script>
<script type="text/javascript">layui.use(['form', 'jquery', 'laydate', 'layer', 'dialog', 'baseutil', 'page'],
    function() {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery,
            baseutil = layui.baseutil,
            dialog = layui.dialog,
            page = layui.page;
        page.initDict("base_status",
            function(dictData) {
                page.showDict($("#status"), page.aceeptDictContentList(dictData, "base_status"), "", '${baseNews.status}');
            });
        form.on('submit(submitBtn)',
            function(data) {
                baseutil.post("/sys/baseNews/addOrUpdate", data.field,
                    function(result) {
                        dialog.msg(result.data);
                        $("#save").click();
                    });
                return false;
            });
    });</script>
</body>

</html>